import Cookies from 'js-cookie'

const key = 'MallToken'
const TenantKey = 'TenantKey'
const Tid = 'Tid'

export function getToken() {
  // return Cookies.get(key)
  return localStorage.getItem(key)
}

export function setToken(token) {
  localStorage.setItem(key,token)
  console.log("token")
  console.log(localStorage.getItem(key))
  // return Cookies.set(key, token, { expires: 15 })
}

export function removeToken() {
  localStorage.removeItem(key)
  // return Cookies.remove(key)
}


export function getTenantKey() {
  // return Cookies.get(TenantKey)
  return localStorage.getItem(TenantKey)

}

export function setTenantKey(keyValue) {
  localStorage.setItem(TenantKey,keyValue)
  // return Cookies.set(TenantKey, keyValue, { expires: 15 })
}

export function removeTenantKey() {
  localStorage.removeItem(TenantKey)
  // return Cookies.remove(TenantKey)
}

export function setTID(id) {
  localStorage.setItem(Tid,id)
  // return Cookies.set(Tid, id, { expires: 15 })
}

export function getTID() {
  return localStorage.getItem(Tid)
  // return Cookies.get(Tid)
}

export function removeTID() {
  localStorage.removeItem(Tid)
  // return Cookies.remove(Tid)
}
